@echo off

IF '%1' == '' GOTO usage
IF /I '%1' == '-?' GOTO usage
IF /I '%1' == '/?' GOTO usage

if /I '%1' == 'on' (
    set AppServerStyleCopEnabled=true
    ECHO StyleCop is enabled
)

if /I '%1' == 'off' (
    set AppServerStyleCopEnabled=false
    ECHO StyleCop is disabled
)

if /I '%1' == 'w' (
    set AppServerStyleCopTreatErrorsAsWarnings=true
    ECHO StyleCop violations are build warnings
)

if /I '%1' == 'e' (
    set AppServerStyleCopTreatErrorsAsWarnings=false
    ECHO StyleCop violations are build errors
)

goto end

:usage

ECHO Enables or disables StyleCop from running when a build is performed. This does not affect official build scripts.
ECHO.
ECHO   stylecop on    StyleCop runs when a build is performed
ECHO   stylecop off   StyleCop does not run when a build is performed
ECHO   stylecop e     StyleCop violations appear as build warnings
ECHO   stylecop w     StyleCop violations appear as build errors
ECHO.
GOTO end

:end